<template>
  <div id="app">
    <app-header></app-header>
    <router-view></router-view>
    <app-footer v-if="hasFooter"></app-footer>
    <vue-progress-bar></vue-progress-bar>
  </div>
</template>
<script>
import AppHeader from '@/nd/components/AppHeader'
import AppFooter from '@/nd/components/AppFooter'
import { PLATFORM_THEME } from '@/nd/plugins/constant'
import { STORAGE_THEME } from '@/common/plugins/constant'
import { themeMixin, progressBarMixin } from '@/common/mixins'

export default {
  components: { AppHeader, AppFooter },
  mixins: [themeMixin, progressBarMixin],
  props: {},
  data() {
    return {
      // 定义各自项目的主题颜色，将会覆盖themeMixin中的theme
      theme: localStorage.getItem(STORAGE_THEME) || PLATFORM_THEME,
    }
  },
  computed: {
    meta() {
      return this.$route.meta || {}
    },
    hasLayout() {
      return this.meta.layout !== false
    },
    hasFooter() {
      return this.hasLayout && this.meta.footer !== false
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>
<style lang="scss"></style>
